When it comes to landscapes, flat is generally boring. More interesting landscapes tend to have hills or sometimes even mountains. Hikers and backpackers generally seek out high places where few ever venture. Climbing up and descending steep slopes is rewarding both mentally and physically. Navigating hilly landscapes similarly is more interesting for the virtual traveler traveling through a virtual landscape in a computer graphics and animation system such as a video game.
In the past, virtual landscape design was typically performed by the game developer and could not be changed by an end user. The virtual landscape might be multi-level, but each level was fixed and predetermined. Some past games such as Nintendo's Pikmin provided randomness in dynamically changing or constructing aspects of virtual game levels and associated landscapes. More recently, some games have empowered end users to create their own levels and associated virtual landscapes.
For example, the Nintendo DS game “Mario vs. Donkey Kong 2: March of the Minis” featured an in-game editor that allowed end users to create their own virtual landscapes. Once created, these virtual landscapes could be exchanged between users throughout a user community to provide an endless supply of new and interesting levels and virtual landscapes. By empowering end users to create aspects of the game they are playing, a high level of interest is maintained and the game supplies an endless source of interest and fascination.
One challenge to providing in-game editing is to reach a good tradeoff between ease of use and flexibility. It is desirable for users to be able to simply place desired structures where they wish in the video game landscape they are building without having to worry about graphical details of how to connect these structures in ways that are aesthetically pleasing and realistic. The challenge to game developers is to come up with in-game editing tools that are easy to use but are also powerful enough to provide high degrees of flexibility.
Some prior game development tools have allowed game developers to construct sloped landscapes. Generally speaking, these prior approaches did so by constraining the slope angles and using a fixed library of connector pieces to connect upper and lower sloped portions with flat or other surfaces. Unfortunately, restricting slope angles has the effect of limiting flexibility. For example, if a slope must always be 45°, then it can be used as a building block only to connect other points that have the appropriate spacing and height to accommodate a 45° slope between them. In contrast, end users may desirably wish to insert a sloped surface to connect virtually any two arbitrary points in the virtual landscape. This presents a challenge since it demands the sloped surface angle and connectors to the other surfaces the sloped surface is joining to be determined dynamically and efficiently.
The exemplary illustrative non-limiting technology herein provides solutions to in-game virtual landscape construction employing sloped surfaces. Within an exemplary illustrative non-limiting game there are both flat and sloped ground surfaces on which the game characters traverse. In areas where a sloped surface changes angle (i.e. where a sloped surface connects to a flat surface), a transitional method has been created to make the adjoining textures on the top surface area of the ground blend together seamlessly.
On the art side, a unique texture is used for this purpose. This texture uses the same material as the flat “ground trim” texture seen on the top of every surface (e.g., the green grass which lines the top surfaces of ground). What makes this texture unique is that it has a diagonally drawn alpha mask that blends from completely transparent to completely opaque from the bottom right corner of the texture to the top left corner. When this texture is drawn at the ends of each sloped surface where they change angle, the combination of the color channels and the alpha mask line up with adjoining textures to blend them together and create a seamless visual transition.
Users can for example design or specify a sloped surface that can have virtually any angle of slope within a range. Advantageous techniques and algorithms are employed to design aesthetically-pleasing and functional-looking connectors between each end of the sloped surface and other structures in the virtual landscape. In one exemplary illustrative non-limiting implementation, appropriate connector pieces such as triangles are dynamically selected and used to provide transition between sloped and other surfaces, and ground texture (in some cases with appropriate alpha gradient) is stretched over such connector pieces to provide aesthetically-pleasing and realistic-looking transitions.